﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace DigitalQuran.Research
{
    /// <summary>
    /// Research Agent
    /// </summary>
    public sealed class ResearchAgent
    {
        /// <summary>
        /// Gets the Client
        /// </summary>
        public Client Client { get; set; }

        public void PopulateResearchMethods()
        {
            
        }
     
        List<MethodInfo> ExtractResearchMethods(MethodInfo[] methods)
        {
            List<MethodInfo> funcs = new List<MethodInfo>();
            foreach (var m in methods)
            {
                foreach (var atrrib in m.GetCustomAttributes(false))
                {
                    if (atrrib is ResearchMethodAttribute)
                    {
                        funcs.Add(m);
                        break;
                    }
                }
            }

            return funcs;
        }

        public void SaveLetters(string filename, char[] letters)
        {
            //TODO: Save Letters
        }

        public void SaveWords(string filename, List<string> words)
        {
            // TODO: Save Words
        }

        public void SaveValues(string filename, List<long> values)
        {
            //TODO: Save Values
        }

        public void SaveText(string filename, string text)
        {
            //TODO: Save Text
        }

        public void SaveCsv(string filename, DataFrame dataframe)
        {
            //TODO: Save CSV
        }
    }
}